package org.ManagerSystem.entity;

import org.springframework.format.annotation.DateTimeFormat;

import java.util.Date;

/**
 * 员工信息实体类
 * 外键的解决方案：在定义时定义一个对象，以便查询对应的数据并将其填充到对应的实体类中
 */
public class Employee {
    //员工 id
    private long eid;
    //员工姓名
    private String ename;
    //员工性别
    private String egender;
    //员工部门（外键）
    private Department edepartment;
    //员工职位（外键）
    private Role erole;
    //员工生日
    @DateTimeFormat(pattern = "yyyy-MM-dd")
    private Date ebirthday;
    //员工入职日期
    @DateTimeFormat(pattern = "yyyy-MM-dd")
    private Date ejoindate;
    //员工编号
    private String enumber;
    //员工用户名
    private String eusername;
    //员工密码
    private String epassword;

    //默认构造方法
    public Employee(){}

    public long getEid() {
        return eid;
    }

    public void setEid(long eid) {
        this.eid = eid;
    }

    public String getEname() {
        return ename;
    }

    public void setEname(String ename) {
        this.ename = ename;
    }

    public String getEgender() {
        return egender;
    }

    public void setEgender(String egender) {
        this.egender = egender;
    }

    public Department getEdepartment() {
        return edepartment;
    }

    public void setEdepartment(Department edepartment) {
        this.edepartment = edepartment;
    }

    public Role getErole() {
        return erole;
    }

    public void setErole(Role erole) {
        this.erole = erole;
    }

    public Date getEbirthday() {
        return ebirthday;
    }

    public void setEbirthday(Date ebirthday) {
        this.ebirthday = ebirthday;
    }

    public Date getEjoindate() {
        return ejoindate;
    }

    public void setEjoindate(Date ejoindate) {
        this.ejoindate = ejoindate;
    }

    public String getEnumber() {
        return enumber;
    }

    public void setEnumber(String enumber) {
        this.enumber = enumber;
    }

    public String getEusername() {
        return eusername;
    }

    public void setEusername(String eusername) {
        this.eusername = eusername;
    }

    public String getEpassword() {
        return epassword;
    }

    public void setEpassword(String epassword) {
        this.epassword = epassword;
    }

    @Override
    public String toString() {
        return "Employee{" +
                "eid=" + eid +
                ", ename='" + ename + '\'' +
                ", egender='" + egender + '\'' +
                ", edepartment=" + edepartment +
                ", erole=" + erole +
                ", ebirthday=" + ebirthday +
                ", ejoindate=" + ejoindate +
                ", enumber='" + enumber + '\'' +
                ", eusername='" + eusername + '\'' +
                ", epassword='" + epassword + '\'' +
                '}';
    }
}
